import Vue from 'vue'
import VueRouter from 'vue-router'
import Main from '@/views/main'
import Home from '@/views/home'
import Details from '@/views/details'
import Play from '@/views/play'


Vue.use(VueRouter)

const routes = [{
  path: '/',
  name: 'main',
  redirect:'/home',
  component: Main,
  children: [{
      path: '/home',
      name: 'home',
      component: Home
    },
    {
      path: '/details',
      name: 'details',
      component: Details
    },
    {
      path: '/play',
      name: 'play',
      component: Play
    }
  ]
}, ]

const router = new VueRouter({
  // mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router